updating oE append_lines

append_lines

include io.e 
namespace io 
public function append_lines(sequence file, sequence lines) 

appends a sequence of lines to a file.

Parameters:
  1. file : an object, either a file path or the handle to an open file.
  2. lines : the sequence of lines to write
Returns:

An integer, 1 on success, -1 on failure.

Errors:

If puts cannot write some line of text, a runtime error will occur.

Comments:

file is opened, written to and then closed.

Example 1:
if append_lines("data.txt", {"This is important data", "Goodbye"}) != -1 then 
    puts(STDERR, "Failed to append data\n") 
end if 
See Also:

write_lines, puts

Not Categorized, Please Help

Search



Quick Links

User menu

Not signed in.

Misc Menu